sizerequest: Cache sizes without size groups
authorBenjamin Otte <otte@redhat.com>
Thu, 1 Nov 2012 23:50:54 +0000 (00:50 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 4 Nov 2012 14:24:17 +0000 (15:24 +0100)
We compute on-demand for size groups anyway, so we can (in theory, this
patch doesn't do that yet) get around costly cache blowing when
invalidating single widgets of a size group this way.

gtk/gtksizerequest.c

index c0e461fe0a9986e5cecdce53adde785c1b8e57da..289317bd65df13c9bf285283d22d7626ff520610 100644 (file)
@@ -464,15 +464,6 @@ compute_size_for_orientation (GtkWidget         *widget,
           nat_size = adjusted_natural;
         }
 
-      /* Update size-groups with our request and update our cached requests
-       * with the size-group values in a single pass.
-       */
-      _gtk_size_group_bump_requisition (widget,
-                                       orientation,
-                                        for_size,
-                                       &min_size,
-                                       &nat_size);
-
       commit_cached_size (widget, orientation, for_size, min_size, nat_size);
     }
   else
@@ -481,6 +472,12 @@ compute_size_for_orientation (GtkWidget         *widget,
       nat_size = cached_size->natural_size;
     }
 
+  _gtk_size_group_bump_requisition (widget,
+                                    orientation,
+                                    for_size,
+                                    &min_size,
+                                    &nat_size);
+
   if (minimum_size)
     *minimum_size = min_size;